<%-- 
    Document   : dislikeupdater
    Created on : Apr 25, 2012, 5:06:58 PM
    Author     : Dell
--%>

<%@ page language="java" import="java.sql.*" %>
<%@ page import="java.io.*,java.sql.*,java.util.*,java.text.*,java.text.SimpleDateFormat" %>
<%@ page import="java.util.List"%>  
<%@ page import="java.util.Iterator"%>  
<%@ page import="org.apache.commons.fileupload.*"%>  
<%@ page import="org.apache.commons.fileupload.disk.*"%>  
<%@ page import="org.apache.commons.fileupload.servlet.*"%> 

<%
    String c = request.getParameter("c");
    
    String driver = "org.gjt.mm.mysql.Driver";
    Class.forName(driver).newInstance();

    Connection con=null;
    ResultSet rst=null;
    Statement stmt=null;

    try{
            String url="jdbc:mysql://localhost:3306/progin_171_13509008?user=root";
            con=DriverManager.getConnection(url);
            stmt=con.createStatement();
    }
    catch(Exception e){
            System.out.println(e.getMessage());
    }
    
    String query = "select count(id_content) as jum from like_content where id_content = "+c+" and status = 2";
    rst=stmt.executeQuery(query);
    rst.first();
    Integer count = rst.getInt("jum");
    
    //out.print("ashes and grey, c is "+c+", counted as "+count);
    out.print(count);
%>